<?xml version="1.0" encoding="windows-1252"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head >
        <title>Meteocal</title>
        <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>-->
    </h:head>
    <h:body>
        <h:form>
            <style>

                .fiftyPercent{
                    width: 50%;
                    text-align: center;
                }

            </style>
            <p:panel header="MeteoCal">
                <h:panelGrid style="width: 100%" columns="2" columnClasses="fiftyPercent,fiftyPercent">
                    <h:panelGrid columns="1" style="width: 99%" id="registrationView">
                        <div align="Center"><p:button outcome="/registration" value="Sign up"/><br/></div>
                    </h:panelGrid>
                    <h:panelGrid columns="1" style="width: 99%" id="loginform">
                        <p:panel header="Login" id="loginView" >

                            <h:panelGrid columns="3" id="loginGrid">
                                <p:outputLabel for="username" value="Username"/>
                                <p:inputText id="username" value="#{loginView.username}"
                                             required="true" />
                                <p:message id="usernamemsg" for="username" />
                                <p:outputLabel for="pass" value="Password"/>
                                <p:password id="pass" value="#{loginView.password}"
                                            required="true" />
                                <p:message id="passmsg" for="pass" />
                                <p:commandButton id="submit" action="#{loginView.login()}" value="Login" ajax="true" update="@all"/>
                                <p:message id="loginmsg" for="submit"/>
                                <h:outputText rendered="#{loginView.failed}" style="color: red; font-family: Times, serif; font-weight: bold; " value="LOGIN FAILED"/>
                            </h:panelGrid>

                        </p:panel>
                    </h:panelGrid>
                </h:panelGrid>
                <div style="position: relative; text-align: center">
                    <p style="position: fixed; bottom: 0; width:100%;"> Powered by Andrea Sorbelli and Michele Zanella</p>
                </div>
            </p:panel>
        </h:form>

    </h:body>
</html>
